package com.api.gbhg.zengping.dao;

import weaver.conn.RecordSetTrans;

import java.util.Map;

/**
 * @program: gbhg-oa
 * @author: Mr.zeng
 * @create: 2021-01-13 14:09
 *
 * 预算来源DAO
 **/
public class BudgetSourceDao {
    public static boolean insertBudgetSource(Map<String,Object> param){
        RecordSetTrans rst=new RecordSetTrans();
        rst.setAutoCommit(false);
        String addSql="insert into uf_jingfeilaiyuan(requestId,sbdw,lcbj,nd,lylx,gnkm,je,syed,ysly,bkxm,bmjjzc)values(?,?,?,?,?,?,?,?,?,?,?)";
        try {
            rst.executeUpdate(addSql,
                    param.getOrDefault("requestId",""),
                    param.getOrDefault("sbdw",""),
                    param.getOrDefault("lcbj",""),
                    param.getOrDefault("nd",""),
                    param.getOrDefault("lylx",""),
                    param.getOrDefault("gnkm",""),
                    param.getOrDefault("je",""),
                    param.getOrDefault("syed",""),
                    param.getOrDefault("ysly",""),
                    param.getOrDefault("bkxm",""),
                    param.getOrDefault("bmjjzc","")
                    );
        } catch (Exception e) {
            e.printStackTrace();
            rst.rollback();
            return false;
        }
        rst.commit();
        return true;
    }
}
